<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
<script>
  /** chrome80+ */
  console.time('cost');
  setTimeout(() => {
    console.timeEnd('cost'); // cost: 2ms+
  }, 0);


  /** chrome中嵌套层数超过5层 最小间隔会调整为4ms*/
  /** https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/core/frame/dom_timer.cc#L39-L46*/
  /*setTimeout(() => {
    setTimeout(() => {
      setTimeout(() => {
        setTimeout(() => {
          console.time('cost');
          setTimeout(() => {
            console.timeEnd('cost'); // 4ms+
          }, 0)
        }, 0)
      }, 0)
    }, 0)
  }, 0);*/
</script>
</body>
</html>
